package com.sp.scmdb.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Type;
import org.joda.time.LocalDate;

import com.sp.scmdb.common.DomainObject;

@Entity
@Table(name = "OBJ_LEADERSHIP")
public class LeaderShip extends DomainObject {

	@Column(name = "empID")
	private Integer empID;
	@Column(name = "workTime")
	@Type(type = "org.joda.time.contrib.hibernate.PersistentLocalDate")
	private LocalDate workTime;
	@Column(name = "shiftsDetailID")
	private Integer shiftsDetailID;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "empID", insertable = false, updatable = false)
	@NotFound(action = NotFoundAction.IGNORE)
	private Employee employee;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "shiftsDetailID", insertable = false, updatable = false)
	@NotFound(action = NotFoundAction.IGNORE)
	private ShiftsDetails shiftsDetail;

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	public ShiftsDetails getShiftsDetail() {
		return shiftsDetail;
	}

	public void setShiftsDetail(ShiftsDetails shiftsDetail) {
		this.shiftsDetail = shiftsDetail;
	}

	public Integer getEmpID() {
		return empID;
	}

	public void setEmpID(Integer empID) {
		this.empID = empID;
	}

	public LocalDate getWorkTime() {
		return workTime;
	}

	public void setWorkTime(LocalDate workTime) {
		this.workTime = workTime;
	}

	public Integer getShiftsDetailID() {
		return shiftsDetailID;
	}

	public void setShiftsDetailID(Integer shiftsDetailID) {
		this.shiftsDetailID = shiftsDetailID;
	}

}
